
**********************************************************************************************
*** Replication Code for the paper "Does Disclosing Well Lead to Doing Good? " ***
***********************  Jinsong Liu,Jiaren Pang,Xinyi Zhang,and Xi Zhou *********************
**********************************************************************************************

*Please refer to "README.docx" for all datasets and code description;
*Data and code are made available for replication purposes only. Any other use without our permission is strictly prohibited;



**# /*Set the path*/
local path "SET WORKING DIRECTORY HERE"
cd `path'


*============================================================
*-Table 1 Sample Selection and Distribution
*=============================================================
*Panel A: Sample selection procedure        
use Initial_sample.dta,clear
*The initial sample of the A-share listed firms from 2006 to 2011
count  //10,592 obs.
merge m:1 stkcd using MandatoryCSRPolicy.dta
drop if _merge==2
*Exclude Treatment firms that were no longer subject to the CSR disclosure mandate in the post-mandate period
drop if TreatSlip ==1  // 240 obs.
*Exclude Firms newly added to the SSE Corporate Governance Index or the Shenzhen 100 Index during the post-mandate period
drop if TreatLater ==1  // 414 obs.
rename TreatInitial  Treat
replace Treat=0 if _merge==1
drop _merge TreatLater TreatSlip
*Exclude Firms that voluntarily released CSR reports during the sample period
g tag=0
replace tag=1 if (Treat==0&csr==1)
bys stkcd:egen sum=sum(tag)
drop if sum>0&Treat==0  // 1138 obs.
drop sum tag
*Exclude Firms in the finance industry
drop if indcd=="I"  // 223 obs.
*Exclude Observations with non-positive shareholders’ equity
drop if equity<=0  // 296 obs.

*Exclude Observations with missing data
foreach v of varlist MV Turnover Return ROE SOE PC Analyst Polluting Donation Leverage OCF Cash RD Patent_Stock{
drop if `v'==.&year<=2008  // variables for PSM, drop 192 obs.
}
foreach v of varlist Size Leverage lnQ PPE CAPEX RD ROA ISHR FSHR MSHR Outside ListAge {
drop if `v'==.  //variables for baseline analysis, drop 720 obs.
}
count  //Final sample consists of 7369 obs.

g Post=0
replace Post=1 if year>2008
g Treat_Post=Treat*Post
label variable Treat "a dummy variable that equals one if the firm is mandated to issue CSR reports and zero otherwise"
label variable Policyyear "mandatory policy year"
label variable Post "a dummy variable that equals one if a firm-year observation falls in the post-mandate period and zero otherwise"
label variable Treat_Post "the interaction term between Post and Treat"

sort stkcd year
egen id=group(stkcd year)
sort id

drop indcd equity csr

global CONTROLS1 "Size Leverage lnQ PPE CAPEX RD ROA ISHR FSHR MSHR Outside ListAge"
global CONTROLS2 "MV lnQ Leverage ROA Return Turnover FSHR SOE"
global PSMCONTROLS "MV Turnover Return ROE SOE PC Analyst Polluting Donation Leverage OCF Cash RD Patent_Stock "

order id stkcd year Treat_Post Treat Post Policyyear Indu* *Ginnov* *Attention* GreenPatent f1RD f1GreenPatent_OECD f1GreenPatents_ECW5_A f1GreenPatents_ECW10_A CarbonEmission $CONTROLS1  $CONTROLS2 $PSMCONTROLS GreenPatent_Comb_pres5 GreenPatent_Comb_pres6 GreenPatent_Comb_pres7 HighTech Court

save Final_sample.dta,replace


*================================================================
*-*Appendix B. Propensity Score Matching Results
*================================================================ 

use Final_sample.dta,clear
keep if year>=2006&year<=2008
foreach v of varlist MV Turnover Return ROE SOE PC Analyst Polluting Donation Leverage OCF Cash RD Patent_Stock {
drop if `v'==.
}
foreach v of varlist MV Turnover Return ROE Analyst Polluting Donation Leverage OCF Cash RD Patent_Stock  {
winsor2 `v',cut( 1 99) replace
}
psmatch2 Treat MV Turnover Return ROE SOE PC Analyst Polluting Donation Leverage OCF Cash RD Patent_Stock i.year i.IndustryCode , neighbor(1) caliper(0.06904629) common  logit ties 
*caliper set at 0.25*standard error of propensity score: 0.06904629
pstest,both  //Panel B: Covariate imbalance testing 
sum _pscore,detail
g cal=r(sd)*0.25
display cal

*Panel A: Logit regression to generate propensity scores
preserve
logit Treat MV Turnover Return ROE SOE PC Analyst Polluting Donation Leverage OCF Cash RD Patent_Stock i.year i.IndustryCode,cluster(stkcd)
est store m1
logit Treat MV Turnover Return ROE SOE PC Analyst Polluting Donation Leverage OCF Cash RD Patent_Stock i.year i.IndustryCode if _weight!=., cluster(stkcd)
est store m2
esttab m1 m2  ,  scalar( N ) pr2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01) keep(MV Turnover Return ROE SOE PC Analyst Polluting Donation Leverage OCF Cash RD Patent_Stock)
restore

drop if _weight==.
keep stkcd 
duplicates drop
save PSM_Firms.dta,replace

use Final_sample.dta,clear
merge m:1 stkcd using PSM_Firms.dta
g psm=1 if _merge==3
drop if _merge==2
drop _merge
label variable psm "PSM sample"
foreach v of varlist Size MV lnQ Leverage PPE CAPEX RD ROA ISHR FSHR MSHR Outside ListAge Return Turnover ///
GreenPatent f1Ginnov f2Ginnov f1GinnovRaw f1Ginnov_Stock f1GreenPatent_OECD f1RD f1Ginnov_Inv f1GreenPatents_ECW5_A f1GreenPatents_ECW10_A ///
EnvAttention NegEnvAttention PosEnvAttention CarbonEmission f1NetEnvAttention {
winsor2 `v',cut( 1 99) replace
}
sort id
save Data_for_mainresults.dta,replace


use Data_for_mainresults.dta,clear
global CONTROLS1 "Size Leverage lnQ PPE CAPEX RD ROA ISHR FSHR MSHR Outside ListAge"

*Figure 1. Green Patents of Treatment and Control Groups
preserve
keep if psm==1
bys Treat year:egen AVCounts=mean(f1GinnovRaw)
keep Treat year AVCounts 
duplicates drop
twoway (connected AVCounts year if Treat==1,lpattern(solid) lcolor(black) mcolor(black) msize(vsmall)) ///
(connected AVCounts year if Treat==0,lpattern(dash) lcolor(gray) mlcolor(gray) mfcolor(white) msize(small) msymbol(circle)) , xlabel(2006(1)2011) xtick(2006(1)2011) ///
xtitle("Year")  ytitle("Green Patents") ylabel(,nogrid angle(0)) xline(2008, lwidth(vthin) lpattern(dash) lcolor(teal)) legend(ring(1) label(1 "Treatment Group ") label(2 "Control Group")  rows(1)  pos(6) ) graphregion(color(white))  scheme(s1mono) 
restore

*============================================================
*-Table 1 Sample Selection and Distribution
*=============================================================

* Panel B: Distribution of treatment and control firms by year
preserve
tab year Treat  // The proportion is calculated manually
tab year Treat if psm==1  // The proportion is calculated manually
restore

* Panel C: Distribution of treatment and control firms by industry
preserve
tab Industry Treat  // The proportion is calculated manually
tab Industry Treat if psm==1  // The proportion is calculated manually
restore


*============================================================
*-Table 2. Descriptive Statistics
*=============================================================

*Panel A: Pooling PSM sample
preserve
keep if psm==1
tabstat f1GinnovRaw f1Ginnov EnvAttention NegEnvAttention PosEnvAttention $CONTROLS1, stat(N mean sd min median max) long format(%9.3f)   col(stat)
restore

*Panel B: PSM treatment firms and control firms
preserve
keep if psm==1
tabstat f1GinnovRaw f1Ginnov  EnvAttention NegEnvAttention PosEnvAttention $CONTROLS1, by(Treat) stat(N mean median) long format(%9.3f) col(stat) nototal
restore


*================================================================
*-Table 3. CSR Disclosure Mandate and Corporate Green Innovation
*================================================================
*Panel A: Main results
preserve
keep if psm==1
qui reghdfe f1Ginnov Treat_Post    ,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
est store m1
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1  ,absorb(stkcd year) vce(cluster stkcd) keepsingletons
est store m2
esttab m1 m2 , scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)		
restore

*Panel B: Dynamic effects
preserve
keep if psm==1
g postm2=0
replace postm2=1 if year==2006
g postm1=0
replace postm1=1 if year==2007
g postp1=0
replace postp1=1 if year==2009
g postp2=0
replace postp2=1 if year==2010
g postp3=0
replace postp3=1 if year==2011
g Treat_B2=Treat*postm2
g Treat_B1=Treat*postm1
g Treat_A1=Treat*postp1
g Treat_A2=Treat*postp2
g Treat_A3=Treat*postp3
qui reghdfe f1Ginnov  Treat_B2 Treat_B1  Treat_A1 Treat_A2 Treat_A3   ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m1
qui reghdfe f1Ginnov  Treat_B2 Treat_B1  Treat_A1 Treat_A2 Treat_A3   $CONTROLS1 ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m2
esttab m1 m2 , scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01) 	
restore

*Panel C: Placebo test using the sample of the pre-mandate period (2006-2008)
preserve
keep if psm==1
g pseudo1=0 if year>=2006&year<=2008
replace pseudo1=1 if year>=2007  //with 2007 being the pseudo enactment year of the mandate
g Treat_ps1=Treat*pseudo1
g pseudo2=0 if year>=2006&year<=2008
replace pseudo2=1 if year>=2008  //with 2008 being the pseudo enactment year of the mandate
g Treat_ps2=Treat*pseudo2
qui reghdfe f1Ginnov Treat_ps1 $CONTROLS1 if year>=2006&year<=2008,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m1
qui reghdfe f1Ginnov Treat_ps2 $CONTROLS1 if year>=2006&year<=2008,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m2
esttab m1 m2 , scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01) 		
restore



		   
*Figure 2. Kernel Density of Coefficient Estimates from 1,000 Random Samples
use Data_for_mainresults.dta,clear
keep if psm==1
preserve
keep Treat stkcd
duplicates drop
tab Treat
restore
drop Treat Policyyear psm Treat_Post
save PlaceboTestData.dta,replace

mat b = J(1000,1,0)
mat se = J(1000,1,0)
mat p = J(1000,1,0)

forvalues i=1/1000{
 use PlaceboTestData.dta,clear
 keep stkcd
 duplicates drop
 set seed `i'
 sample 260, count
 merge 1:m stkcd using PlaceboTestData.dta
 gen Treat = (_merge == 3)
 gen Treat_Post = Treat*Post
 qui reghdfe f1Ginnov Treat_Post  $CONTROLS1  ,absorb(stkcd year) vce(cluster stkcd) 
 mat b[`i',1] = _b[Treat_Post]
 mat se[`i',1] = _se[Treat_Post]

 mat p[`i',1] = 2*ttail(e(df_r), abs(_b[Treat_Post]/_se[Treat_Post]))
}
svmat b, names(coef)
svmat se, names(se)
svmat p, names(pvalue)
drop if pvalue1 == .
label var pvalue1 p_value
label var coef1 estimated_coefficients
label var se1 standard_errors
keep coef1 se1 pvalue1 
save PlaceboResult.dta,replace

use PlaceboResult.dta,clear
sort coef1
sum coef1,detail
g n=_n
g pct=n/1000
list coef1 pct if n==995
*To draw the kernel density of coefficient estimates of the interaction term
twoway kdensity coef1,ytitle("Kernel Density") ylabel(,angle(0)) ///
xlabel(-0.25(0.05)0.25, format(%9.2fc) ) xline(0.202, lwidth(vthin) lp(solid)) xline(0.12878, lwidth(vthin) lp(shortdash)) xtitle("Coefficients") ///
graphregion(color(white)) scheme(s1mono) text(7.7 0.12 "Estimate in column (2) of Table 3", place(w) box  tstyle(smbody) size(6pt))  text(6 0.12 "99% critical value", place(w) box tstyle(smbody) size(6pt))


*================================================================
*-Table 4. Robustness Tests
*================================================================

use Data_for_mainresults.dta,clear
*Panel A: Alternative Specifications:Fixed-effect negative binomial model estimated with the pre-sample mean estimator of Blundell et al. (1999)
preserve
drop if GreenPatent_Comb_pres5==.
g Y_bar5=GreenPatent_Comb_pres5
drop if GreenPatent_Comb_pres6==.
g Y_bar6=GreenPatent_Comb_pres6
drop if GreenPatent_Comb_pres7==.
g Y_bar7=GreenPatent_Comb_pres7
winsor2  Y_bar5  Y_bar6  Y_bar7,cut( 1 99) replace
keep if psm==1
nbreg f1GinnovRaw Treat_Post Y_bar5  $CONTROLS1 i.year , vce (cluster stkcd) 
est store m1
 nbreg f1GinnovRaw Treat_Post Y_bar6  $CONTROLS1 i.year , vce (cluster stkcd) 
est store m2
 nbreg f1GinnovRaw Treat_Post Y_bar7  $CONTROLS1 i.year , vce (cluster stkcd) 
est store m3
esttab m1 m2 m3 ,  scalar( N ) drop( *year* )	pr2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01) 		
restore
*LR test of alpha=0
preserve
drop if GreenPatent_Comb_pres5==.
g Y_bar5=GreenPatent_Comb_pres5
drop if GreenPatent_Comb_pres6==.
g Y_bar6=GreenPatent_Comb_pres6
drop if GreenPatent_Comb_pres7==.
g Y_bar7=GreenPatent_Comb_pres7
winsor2  Y_bar5  Y_bar6  Y_bar7,cut( 1 99) replace
keep if psm==1
nbreg f1GinnovRaw Treat_Post Y_bar5   $CONTROLS1  i.year  
display( e(chi2_c))
nbreg f1GinnovRaw Treat_Post Y_bar6   $CONTROLS1  i.year
 display( e(chi2_c))
nbreg f1GinnovRaw Treat_Post Y_bar7  $CONTROLS1  i.year
 display( e(chi2_c))
restore


*Panel B: Alternative dependent variables
use Data_for_mainresults.dta,clear
preserve
keep if psm==1
qui reghdfe f2Ginnov Treat_Post $CONTROLS1  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m1
qui reghdfe f1Ginnov_Stock Treat_Post $CONTROLS1  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m2
qui reghdfe f1GreenPatent_OECD Treat_Post $CONTROLS1  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m3
qui reghdfe f1RD Treat_Post $CONTROLS1 ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m4
esttab m1 m2 m3 m4  , scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)	
restore


*Panel C: Alternative samples
use Data_for_mainresults.dta,clear
preserve
g n=1
bys stkcd :egen sum=sum(n) if year<=2008
bys stkcd:egen minp0=min(sum)
drop sum
bys stkcd :egen sum=sum(n) if year>2008
bys stkcd:egen minp1=min(sum)
drop sum
g balance=1 if minp0!=.&minp1!=.
qui reghdfe f1Ginnov Treat_Post $CONTROLS1  ,absorb(stkcd year) vce(cluster stkcd)   keepsingletons  //Full sample
est store m1
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if balance==1&psm==1 ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons  //Balanced PSM sample
est store m2
esttab m1 m2   ,  scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)			
restore

use Data_for_Expanded_PSM.dta,clear
qui reghdfe f1Ginnov Treat_Post   $CONTROLS1  ,absorb(stkcd year) vce(cluster stkcd)   keepsingletons  //Expanded PSM sample
est store m1
esttab m1    ,  scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)	


*Panel D: Controlling for contemporaneous policy shocks
use Data_for_mainresults.dta,clear
preserve
keep if psm==1
qui reghdfe f1Ginnov Treat_Post HighTech   $CONTROLS1 ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons //High-tech Enterprise Recognition
est store m1
qui reghdfe f1Ginnov Treat_Post  Court  $CONTROLS1 ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons //Environmental Protection Court
est store m2
qui reghdfe f1Ginnov Treat_Post HighTech Court   $CONTROLS1  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons  //Both Policy Shocks
est store m3
esttab m1 m2 m3   , scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)		
restore


*================================================================
*-Table 5. CSR Disclosure Mandate and Media Environmental Attention
*================================================================

use Data_for_mainresults.dta,clear
global CONTROLS2 "MV lnQ Leverage ROA Return Turnover FSHR SOE"

preserve
keep if  psm==1
qui reghdfe EnvAttention Treat_Post  $CONTROLS2  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m1
qui reghdfe NegEnvAttention Treat_Post  $CONTROLS2  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m2
qui reghdfe PosEnvAttention Treat_Post  $CONTROLS2 ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m3
esttab m1 m2 m3 , scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)	
restore	 
*footnote 14
preserve
keep if  psm==1
qui reghdfe EnvAttention Treat_Post  $CONTROLS1  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m1
qui reghdfe NegEnvAttention Treat_Post  $CONTROLS1  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m2
qui reghdfe PosEnvAttention Treat_Post  $CONTROLS1 ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m3
esttab m1 m2 m3 , scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)	
restore	 

*================================================================
*-Table 6. Heterogeneity in Stakeholders’ Environmental Awareness
*================================================================

use Data_for_mainresults.dta,clear
keep if psm==1
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighGA==1,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m1
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighGA==0,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m2
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighBSI==1,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m3
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighBSI==0,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m4
esttab m1 m2 m3 m4  , scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)

*================================================================
*-*Table 7. CSR Disclosure Mandate and Green Innovation Quality
*================================================================

use Data_for_mainresults.dta,clear
keep if psm==1
qui reghdfe f1Ginnov_Inv Treat_Post  $CONTROLS1  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m1
qui reghdfe f1GreenPatents_ECW5_A Treat_Post $CONTROLS1  ,absorb(stkcd year) vce(cluster stkcd)   keepsingletons
est store m2
qui reghdfe f1GreenPatents_ECW10_A Treat_Post $CONTROLS1  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons 
est store m3
esttab m1 m2 m3 , scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)

*================================================================
*-*Table 8. Cross-Sectional Tests
*================================================================   
*Panel A. Conditional on innovation capability
use Data_for_mainresults.dta,clear	   
preserve
keep if psm==1
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1  if HavingGP==1,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m1
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1  if HavingGP==0,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m2
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1  if HighPatent==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
est store m3
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1  if HighPatent==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
est store m4
esttab m1 m2 m3 m4,scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)
restore

*Panel B. Conditional on innovation incentives
preserve
keep if psm==1
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1  if HighAssetSpec==1,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m1
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1  if HighAssetSpec==0,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m2
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1  if HighLitigationRisk==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
est store m3
qui reghdfe f1Ginnov Treat_Post $CONTROLS1  if HighLitigationRisk==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
est store m4
esttab m1 m2 m3 m4 , scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)
restore

*Panel C. Conditional on financial constraints
preserve
keep if psm==1
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1  if HighOCF==1,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m1
qui reghdfe f1Ginnov Treat_Post $CONTROLS1  if HighOCF==0,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m2
qui reghdfe f1Ginnov Treat_Post $CONTROLS1  if HighCOE==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
est store m3
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1  if HighCOE==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
est store m4
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1  if HighSA==0,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m5
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1  if HighSA==1,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m6
esttab m1 m2 m3 m4 m5 m6,  scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)
restore


*================================================================
*-*Table 9. The Effects of Mandatory vs. Voluntary CSR Disclosure
*================================================================   
	   
*Panel A: Using voluntary CSR disclosure firms as treatment firms
use Data_for_Voluntary_CSR1.dta,clear
qui reghdfe f1Ginnov Treat_Post $CONTROLS1 ,absorb(stkcd year) vce(cluster stkcd) keepsingletons
est store m1
qui reghdfe EnvAttention Treat_Post  $CONTROLS2  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m2
qui reghdfe NegEnvAttention Treat_Post  $CONTROLS2  ,absorb(stkcd year) vce(cluster stkcd)   keepsingletons
est store m3
qui reghdfe PosEnvAttention Treat_Post  $CONTROLS2  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m4
esttab m1 m2 m3 m4, scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)

*footnote 18
qui reghdfe f1Ginnov Voluntary $CONTROLS1 ,absorb(stkcd year) vce(cluster stkcd) keepsingletons
est store m1
qui reghdfe EnvAttention Voluntary  $CONTROLS2  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m2
qui reghdfe NegEnvAttention Voluntary  $CONTROLS2  ,absorb(stkcd year) vce(cluster stkcd)   keepsingletons
est store m3
qui reghdfe PosEnvAttention Voluntary  $CONTROLS2  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m4
esttab m1 m2 m3 m4, scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)

*Panel B: Using voluntary CSR disclosure firms as control firms
use Data_for_Voluntary_CSR2.dta,clear
qui reghdfe f1Ginnov Treat_Post $CONTROLS1 ,absorb(stkcd year) vce(cluster stkcd) keepsingletons
est store m1
qui reghdfe EnvAttention Treat_Post  $CONTROLS2  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m2
qui reghdfe NegEnvAttention Treat_Post  $CONTROLS2  ,absorb(stkcd year) vce(cluster stkcd)   keepsingletons
est store m3
qui reghdfe PosEnvAttention Treat_Post  $CONTROLS2  ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m4
esttab m1 m2 m3 m4, scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)


*================================================================
*-*Table 10. Green Innovation and Environmental Performance
*================================================================ 

use Data_for_mainresults.dta,clear	   
keep if psm==1
qui reghdfe CarbonEmission GreenPatent   $CONTROLS1  ,absorb(stkcd year) vce(cluster stkcd)   keepsingletons
est store m1
qui reghdfe f1NetEnvAttention  GreenPatent    $CONTROLS2   ,absorb(stkcd year) vce(cluster stkcd)  keepsingletons
est store m2
esttab m1 m2  , scalar( N absvars) ar2(%9.3f) b(%9.3f) se(%9.3f)	star(* 0.1 ** 0.05 *** 0.01)

	





*================================================================
*-Fisher's Permutation tests in Table 6 and Table 8
*================================================================ 
   
*p-value for testing the equality of the coefficients of Treat×Post using subsamples with high and low governmental attention (Table 6)
use Data_for_mainresults.dta,clear	   
global CONTROLS1 "Size Leverage lnQ PPE CAPEX RD ROA ISHR FSHR MSHR Outside ListAge"
tab HighGA if psm==1
keep if psm==1
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighGA==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighGA==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b2=_b[Treat_Post]
scalar diff0=`b1'-`b2'
dis "diff0_Treat_Post=" scalar(diff0)
*Fisher's Permutation test
set matsize 11000
local reps=1000
mat D=J(`reps',3,.)
forvalues j=1/`reps' {
qui use Data_for_mainresults.dta,clear	   
keep if psm==1
set seed `j'
generate r=uniform()
sort r id 
g rank=_n   
g high=1 if rank<=1597
replace high=0 if high==.
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b2=_b[Treat_Post]
local diff=`b1'-`b2'
mat D[`j',1]=(`b1',`b2',`diff')
}
svmat D,names(d)
mat drop _all
rename d1 b1
rename d2 b2
rename d3 diff
drop if diff==.
count if diff>diff0
local p=`r(N)'/1000
dis "empirical p-value =" `p'


*p-value for testing the equality of the coefficients of Treat×Post using subsamples with high and low PM2.5 Baidu search indices (BSI)  (Table 6)
use Data_for_mainresults.dta,clear	   
global CONTROLS1 "Size Leverage lnQ PPE CAPEX RD ROA ISHR FSHR MSHR Outside ListAge"
tab HighBSI if psm==1
keep if psm==1
drop if HighBSI==.
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighBSI==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighBSI==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b2=_b[Treat_Post]
scalar diff0=`b1'-`b2'
dis "diff0_Treat_Post=" scalar(diff0)
*Fisher's Permutation test
set matsize 11000
local reps=1000
mat D=J(`reps',3,.)
forvalues j=1/`reps' {
qui use Data_for_mainresults.dta,clear	  
keep if psm==1
drop if HighBSI==.
set seed `j'
generate r=uniform()
sort r id
g rank=_n   
g high=1 if rank<=1851
replace high=0 if high==.
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b2=_b[Treat_Post]
local diff=`b1'-`b2'
mat D[`j',1]=(`b1',`b2',`diff')
}
svmat D,names(d)
mat drop _all
rename d1 b1
rename d2 b2
rename d3 diff
drop if diff==.
count if diff>diff0
local p=`r(N)'/1000
dis "empirical p-value =" `p'


*p-value for testing the equality of the coefficients of Treat×Post using subsamples with and without green innovation history during the pre-mandate period  (Table 8)
use Data_for_mainresults.dta,clear	   
global CONTROLS1 "Size Leverage lnQ PPE CAPEX RD ROA ISHR FSHR MSHR Outside ListAge"
tab HavingGP if psm==1
keep if psm==1
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HavingGP==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HavingGP==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b2=_b[Treat_Post]
scalar diff0=`b1'-`b2'
dis "diff0_Treat_Post=" scalar(diff0)
*Fisher's Permutation test
set matsize 11000
local reps=1000
mat D=J(`reps',3,.)
forvalues j=1/`reps' {
qui use Data_for_mainresults.dta,clear	   
keep if psm==1
set seed `j'
generate r=uniform()
sort r id
g rank=_n   
g high=1 if rank<= 1354
replace high=0 if high==.
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b2=_b[Treat_Post]
local diff=`b1'-`b2'
mat D[`j',1]=(`b1',`b2',`diff')
}
svmat D,names(d)
mat drop _all
rename d1 b1
rename d2 b2
rename d3 diff
drop if diff==.
count if diff>diff0
local p=`r(N)'/1000
dis "empirical p-value =" `p'


*p-value for testing the equality of the coefficients of Treat×Post using subsamples with high and low innovation output   (Table 8)
use Data_for_mainresults.dta,clear	   
global CONTROLS1 "Size Leverage lnQ PPE CAPEX RD ROA ISHR FSHR MSHR Outside ListAge"
tab HighPatent if psm==1
keep if psm==1
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighPatent==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighPatent==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b2=_b[Treat_Post]
scalar diff0=`b1'-`b2'
dis "diff0_Treat_Post=" scalar(diff0)
*Fisher's Permutation test
set matsize 11000
local reps=1000
mat D=J(`reps',3,.)
forvalues j=1/`reps' {
qui use Data_for_mainresults.dta,clear	
keep if psm==1
set seed `j'
generate r=uniform()
sort r id
g rank=_n   
g high=1 if rank<= 1468
replace high=0 if high==.
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b2=_b[Treat_Post]
local diff=`b1'-`b2'
mat D[`j',1]=(`b1',`b2',`diff')
}
svmat D,names(d)
mat drop _all
rename d1 b1
rename d2 b2
rename d3 diff
drop if diff==.
count if diff>diff0
local p=`r(N)'/1000
dis "empirical p-value =" `p'


*p-value for testing the equality of the coefficients of Treat×Post using subsamples with high and low asset specificity   (Table 8)
use Data_for_mainresults.dta,clear	   
global CONTROLS1 "Size Leverage lnQ PPE CAPEX RD ROA ISHR FSHR MSHR Outside ListAge"
tab HighAssetSpec if psm==1
keep if psm==1
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighAssetSpec==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighAssetSpec==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b2=_b[Treat_Post]
scalar diff0=`b1'-`b2'
dis "diff0_Treat_Post=" scalar(diff0)
*Fisher's Permutation test
set matsize 11000
local reps=1000
mat D=J(`reps',3,.)
forvalues j=1/`reps' {
qui use Data_for_mainresults.dta,clear	 
keep if psm==1
set seed `j'
generate r=uniform()
sort r id 
g rank=_n   
g high=1 if rank<=1953
replace high=0 if high==.
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b2=_b[Treat_Post]
local diff=`b1'-`b2'
mat D[`j',1]=(`b1',`b2',`diff')
}
svmat D,names(d)
mat drop _all
rename d1 b1
rename d2 b2
rename d3 diff
drop if diff==.
count if diff>diff0
local p=`r(N)'/1000
dis "empirical p-value =" `p'


*p-value for testing the equality of the coefficients of Treat×Post using subsamples with high and low patent litigation risk   (Table 8)
use Data_for_mainresults.dta,clear	   
global CONTROLS1 "Size Leverage lnQ PPE CAPEX RD ROA ISHR FSHR MSHR Outside ListAge"
tab HighLitigationRisk if psm==1
keep if psm==1
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighLitigationRisk==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighLitigationRisk==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b2=_b[Treat_Post]
scalar diff0=`b2'-`b1'
dis "diff0_Treat_Post=" scalar(diff0)
*Fisher's Permutation test
set matsize 11000
local reps=1000
mat D=J(`reps',3,.)
forvalues j=1/`reps' {
qui use Data_for_mainresults.dta,clear
keep if psm==1
set seed `j'
generate r=uniform()
sort r id 
g rank=_n   
g high=1 if rank<= 1042
replace high=0 if high==.
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b2=_b[Treat_Post]
local diff=`b2'-`b1'
mat D[`j',1]=(`b1',`b2',`diff')
}
svmat D,names(d)
mat drop _all
rename d1 b1
rename d2 b2
rename d3 diff
drop if diff==.
count if diff>diff0
local p=`r(N)'/1000
dis "empirical p-value =" `p'





*p-value for testing the equality of the coefficients of Treat×Post using subsamples with high and low internal financing capacity   (Table 8)
use Data_for_mainresults.dta,clear	   
global CONTROLS1 "Size Leverage lnQ PPE CAPEX RD ROA ISHR FSHR MSHR Outside ListAge"
tab HighOCF if psm==1
keep if psm==1
drop if HighOCF==.
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighOCF==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighOCF==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b2=_b[Treat_Post]
scalar diff0=`b1'-`b2'
dis "diff0_Treat_Post=" scalar(diff0)
*Fisher's Permutation test
set matsize 11000
local reps=1000
mat D=J(`reps',3,.)
forvalues j=1/`reps' {
qui use Data_for_mainresults.dta,clear	 
keep if psm==1
drop if HighOCF==.
set seed `j'
generate r=uniform()
sort r id 
g rank=_n   
g high=1 if rank<=1427
replace high=0 if high==.
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b2=_b[Treat_Post]
local diff=`b1'-`b2'
mat D[`j',1]=(`b1',`b2',`diff')
}
svmat D,names(d)
mat drop _all
rename d1 b1
rename d2 b2
rename d3 diff
drop if diff==.
count if diff>diff0
local p=`r(N)'/1000
dis "empirical p-value =" `p'



*p-value for testing the equality of the coefficients of Treat×Post using subsamples with high and low costs of equity   (Table 8)
use Data_for_mainresults.dta,clear	   
global CONTROLS1 "Size Leverage lnQ PPE CAPEX RD ROA ISHR FSHR MSHR Outside ListAge"
tab HighCOE if psm==1
keep if psm==1
drop if HighCOE==.
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighCOE==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighCOE==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b2=_b[Treat_Post]
scalar diff0=`b2'-`b1'
dis "diff0_Treat_Post=" scalar(diff0)
*Fisher's Permutation test
set matsize 11000
local reps=1000
mat D=J(`reps',3,.)
forvalues j=1/`reps' {
qui use Data_for_mainresults.dta,clear	
keep if psm==1
drop if HighCOE==.
set seed `j'
generate r=uniform() 
sort r id
g rank=_n   
g high=1 if rank<=1212
replace high=0 if high==.
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b2=_b[Treat_Post]
local diff=`b2'-`b1'
mat D[`j',1]=(`b1',`b2',`diff')
}
svmat D,names(d)
mat drop _all
rename d1 b1
rename d2 b2
rename d3 diff
drop if diff==.
count if diff>diff0
local p=`r(N)'/1000
dis "empirical p-value =" `p'



*p-value for testing the equality of the coefficients of Treat×Post using subsamples with  low and high financial constraints   (Table 8)
use Data_for_mainresults.dta,clear	   
global CONTROLS1 "Size Leverage lnQ PPE CAPEX RD ROA ISHR FSHR MSHR Outside ListAge"
tab HighSA if psm==1
keep if psm==1
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighSA==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if HighSA==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons
local b2=_b[Treat_Post]
scalar diff0=`b2'-`b1'
dis "diff0_Treat_Post=" scalar(diff0)
*Fisher's Permutation test
set matsize 11000
local reps=1000
mat D=J(`reps',3,.)
forvalues j=1/`reps' {
qui use Data_for_mainresults.dta,clear
keep if psm==1
set seed `j'
generate r=uniform()
sort r id 
g rank=_n   
g high=1 if rank<=1391
replace high=0 if high==.
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==1,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b1=_b[Treat_Post]
qui reghdfe f1Ginnov Treat_Post  $CONTROLS1 if high==0,absorb(stkcd year) vce(cluster stkcd) keepsingletons 
local b2=_b[Treat_Post]
local diff=`b2'-`b1'
mat D[`j',1]=(`b1',`b2',`diff')
}
svmat D,names(d)
mat drop _all
rename d1 b1
rename d2 b2
rename d3 diff
drop if diff==.
count if diff>diff0
local p=`r(N)'/1000
dis "empirical p-value =" `p'